<?php
declare(strict_types=1);
//新建一个提供服务的yar servicer

class c_rpc_server
{
    public function server_handle()
    {
        $server = new Yar_Server(new c_rpc_server);
        return $server->handle();
    }
    public function hello($name, $name2)
    {
        $redis = Cache::getInstance();
        try {
            $redis->incr('sen');
        } catch (Exception $e) {
            echo $e->getMessage();
        }
        return $name ."<hr>" . $name2;
    }
    public function run($class,$method,$id)
    {
        $queue_model = new Queue();
        $queue = $queue_model->where('id',$id)->fetch();
        call_user_func([new $class,$method],$queue);
        return true;
    }
}

